package com.outlook.flowervowlogin;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;

public class Main extends JavaPlugin {
    public static Main instance;
    @Override
    public void onEnable(){
        instance = this;
        saveDefaultConfig();
        Bukkit.getConsoleSender().sendMessage("§2茶姬Studio§a[TeabaneLogin] Flowervow");

        File dir = new File(Main.instance.getDataFolder(), "Player");
        if (!dir.exists()){
                dir.mkdir();
                Bukkit.getConsoleSender().sendMessage("§b[TeabaneLogin]配置文件创建成功");
        }

        getCommand("reg").setExecutor(new CommandReg(this));
        getCommand("l").setExecutor(new CommandLogin(this));
        getCommand("captcha").setExecutor(new CommandCaptcha(this));

        getServer().getPluginManager().registerEvents(new EventJoin(this),this);
        getServer().getPluginManager().registerEvents(new CommandLimit(),this);


        final EventJoin class2 = new EventJoin(this);
        final CommandLogin class1 = new CommandLogin(this);
        final CommandCaptcha class3 = new CommandCaptcha(this);
        final CommandReg class4 = new CommandReg(this);


        getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
    }
    @Override
    public void onDisable(){
        Bukkit.getConsoleSender().sendMessage("§2茶姬Studio§a[TeabaneLogin] Flowervow已卸载");
    }
}
